<template>
	<view class="message-container">
		<u-swiper :list="swiperList"></u-swiper>

		<u-list class="message-list" @scrolltolower="scrolltolower">
			<u-list-item v-for="(item, index) in indexList" :key="index">
				<u-cell @click="linkInner">
					<template slot="icon">
						<view>
							<u-avatar size="32"
								:src="item.url || 'https://cdn.qiuqiuqiu.top/cZnpgxLfZijbrDhnKOwUZws_ZbKJ9wyrWUK1yDqF5_PAv8cYoDOhPxyJQ6eLE0zE.png'"
								customStyle="margin: -3px 5px -3px 0"></u-avatar>
						</view>
						<view class="message-text">
							<view>{{ item.name }}</view>
							<view>{{ item.remark }}</view>
						</view>
					</template>

					<template slot='value'>
						<text style="font-size: 12px;">{{ item.createTime }}</text>

					</template>

				</u-cell>
			</u-list-item>
		</u-list>
		<customTabbar :curr-page="3" :key="$store.state.internationalization.number" />
	</view>
</template>

<script>
	import customTabbar from "../../wxcomponents/customTabbar.vue";
	import {
		serviceList
	} from '@/http/customerService/index.js'
	export default {
		components: {
			customTabbar,
		},
		name: 'message',
		data() {
			return {
				swiperList: [
					'https://img.js.design/assets/img/65ddacbfd7645d32282aa784.png#929ba637f2c534b7291c59d6408338c5'
				],
				indexList: []
			}
		},
		onLoad() {
			this.loadmore();

		},
		onShow() {
			this.loadmore();

		},
		methods: {
			async loadmore() {
				const {
					rows,
					total
				} = await serviceList()
				this.indexList = rows
			},

			linkInner() {
				uni.navigateTo({
					url: "/pages/Messag/msgInner",
				});
			},

		},
	}
</script>


<style lang="less" scoped>
	.message-container {
		padding: 80rpx 32rpx 0;

		/deep/ .u-cell__body {
			height: 144rpx;

		}
	}

	.message-list {
		margin-top: 20rpx;
	}

	.message-text {
		margin-left: 16rpx;
		font-size: 12px;
		color: rgba(51, 51, 51, 1);

	}
</style>
